// pages/mine/mine.js
import Dialog from '../../vant-weapp/dialog/dialog';
import fw from "../../core/framework.js"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    name:'',
    mobile:''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    var userData = fw.user.get();
    var mobile = userData.mobile||"";
    this.setData({
      merchantName:userData.merchantName,
      name: userData.username,
      mobile:mobile.substr(0,3)+"****"+mobile.substr(7),
      role:userData.role == 1 ? '管理员':'普通用户'
    })
  },
  quit: function () {
    fw.user.remove();
    fw.url.back();
  }
})